package jinyilw.swing.visuals.Icomp;

import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JMenuItem;

import jinyilw.swing.i18n.ICSetting;
import jinyilw.swing.i18n.LanguageChanger;

public class IMenuItem extends JMenuItem implements LanguageChanger
{
	private static final long serialVersionUID = -3526800117740917201L;
	protected ICSetting i18nSetting;

	public IMenuItem()
	{
	}

	public IMenuItem(Icon icon)
	{
		super(icon);
	}

	public IMenuItem(String text)
	{
		super(text);
	}

	public IMenuItem(Action a)
	{
		super(a);
	}

	public IMenuItem(String text, Icon icon)
	{
		super(text, icon);
	}

	public IMenuItem(String text, int mnemonic)
	{
		super(text, mnemonic);
	}

	public IMenuItem(ICSetting iSetting)
	{
		setText(iSetting);
	}
	public IMenuItem(ICSetting iSetting, Icon icon)
	{
		super("", icon);
		setText(iSetting);
	}
	public IMenuItem(ICSetting iSetting, int mnemonic)
	{
		super("", mnemonic);
		setText(iSetting);
	}

	public void setICSetting(ICSetting iSetting)
	{
		i18nSetting = iSetting;
	}

	@Override
	public ICSetting getICSetting()
	{
		return i18nSetting;
	}

	@Override
	public void updateText(String text)
	{
		setText(text);
	}
}
